<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>

<body>
    <div id="app">
        <p>父传子</p>
        <blog-post word="222222"></blog-post>
        <blog-post :word="selected"></blog-post>
    </div>
    <script>
        Vue.component('blog-post', {
            props: ['post'],
            template: `
           <div class="blog-post">
             <h3>{{title}}</h3>
             <h3>{{word}}</h3>
             <button @click="handleClick()">
               Enlarge text
             </button>
             <div ></div>
           </div>
         `,
          props:{
            word:{
                type: String,
                required: true
            }
          
          },

            data() {
                return {
                    title: "你好组件",
                }
            },
            methods: {
                handleClick() {
                   console.log(this.word);

                }

            },
            


        })
        var vm = new Vue({
            el: "#app",
            data: {
                checkedNames: [],
                picked: "",
                selected: 'A',

            },
            methods:{
                handleEvent(event,data){
                  console.log(event);

                }


            }

        });

    </script>


</body>

</html>